static const char * const MY_LOG_PROCS[] = {"com.sonyericsson.album","com.android.gallery3d"};
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
static int is_proc_self(const char * const in_names[]) {
    FILE *f_status = NULL;
    char *buffer = NULL;
    size_t count = 0;
    int ret = 0;

    if (sizeof(MY_LOG_PROCS) == 0) {
        ret = 1;
    } else {
        f_status = fopen("/proc/self/cmdline", "r");
        getline(&buffer, &count, f_status);
        int loop = sizeof(MY_LOG_PROCS) / sizeof(MY_LOG_PROCS[0]);

        for(; loop >= 0; loop --) {
            //ALOGD("readed: %s", buffer);
            if ( strstr(in_names[loop], buffer) || strstr(buffer, in_names[loop]) ) {
                ret = 1;
                break;
            }
        }
        free(buffer);
        fclose(f_status);
    }
    return ret;
}
#define MY_LOG(fmt,...) do {\
    if (is_proc_self(MY_LOG_PROCS)) {\
        ALOGD("\033[01;36m[TID %d] " fmt "\033[0m", gettid(), ##__VA_ARGS__); \
    }\
} while (0)
